# Author:: Alexandre Ribeiro de Souza (<alexandre@lumis.com.br>)

package "sudo" do
  action :upgrade
  not_if "test -f /usr/bin/sudo"
end

template "/etc/sudoers.d/sudoers" do
  source "sudoers.erb"
  mode 0440
  owner "root"
  group "root"
  variables(
    :sudoers_groups => node['authorization']['sudo']['groups'],
    :sudoers_users => node['authorization']['sudo']['users'],
    :passwordless => node['authorization']['sudo']['passwordless'],
    :services => node['authorization']['sudo']['allow_services'],
    :user => node['authorization']['system']['user']
  )
end